﻿<QueryViewSpec
	xmlns="bb_appfx_queryview"
	xmlns:common="bb_appfx_commontypes" 
	ID="0278693f-0713-4795-a4df-b6069846ba96"
	Name="Address Extension Query"
	Description="Provides query functionality for address lookup ID and other extensions."
	Author="Blackbaud Professional Services"
	IsRoot="false"
	PrimaryKeyField="ID"
	RecordType="Address"
	common:SecurityUIFolder="Service Bus Adapter"
	>

	<!-- define the view used to return data for the query -->
	<ViewImplementation ViewName="USR_V_QUERY_ADDRESSEXTENSION">
		<ViewSQL>
			<![CDATA[
select
	ID,
	LOOKUPID
from 
  dbo.USR_ADDRESS				
			]]>
		</ViewSQL>
	</ViewImplementation>

	<!-- describe each field in the view output -->
	<Output>
		<OutputFields>
			<OutputField Caption="System record ID" Category="System Fields" Name="ID" />
			<OutputField Name="LOOKUPID" Caption="Lookup ID" DataType="String" />
		</OutputFields>
	</Output>

  <RelationshipOperations>
    <AddToParentView ParentView="V_QUERY_CONSTITUENTADDRESS" Field="ID" ParentViewRelatedField="ID" PathAlias="Address Extension"/>
    <AddToParentView ParentView="V_QUERY_CONSTITUENTPRIMARYADDRESS" Field="ID" ParentViewRelatedField="ID" PathAlias="Address Extension"/>
  </RelationshipOperations>

</QueryViewSpec>

